home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d21 / bg.arc / BG.ASM next >
Assembly Source File  |  1989-06-13  |  2KB  |  63 lines

  1. ; Version 4/18/89
  2.  
  3. ; BG is written by David Page, Fidonet 109/104 (109/20). I hereby contribute
  4. ; this code to the public domain. It is guaranteed to do nothing but take up
  5. ; a rather small amount of disk space; use at your own risk. On my machine,
  6. ; it does a nice job.
  7.  
  8. ; BG is executed with no parameters, and has the sole effect of making
  9. ; the current DESQview window the furthest backgound one. If executed without
  10. ; DESQview present, it will issue a message and quit.
  11.  
  12. _text   segment
  13.         assume  cs:_text,ds:_text,ss:_text
  14.     org    100h        ;this is a com file
  15. start:
  16.         jmp     begin
  17.  
  18. msg     db      1bh,10h        ; signify manager stream
  19.         dw      strml           ; length of stream without prefix
  20. strm    db      0c9h            ; window stream to make background
  21. msgl    equ    $-msg        ; length of msg
  22. strml   equ     $-strm          ; length of actual stream without prefix
  23.  
  24. abort_msg    db    "DESQview not present!",0dh,0ah,"$"
  25.  
  26. begin:
  27.     mov    cx,'DE'        ; setup to test for DESQview
  28.     mov    dx,'SQ'        ; finish setup for DV test
  29.         mov     ax,2b01h        ; DOS set date function, will be intercepted
  30.                 ; by DV if present, else DOS will return error
  31.                 ; for bad date
  32.     int    21h        ; call DOS
  33.     cmp    al,0ffh        ; did DOS return error?
  34.     je    abort        ; if so, abort
  35.  
  36. ; actual message to make current window background is sent below
  37.  
  38.         lea     si,msg          ; address of msg
  39.     push    cs        ; the address is CS, not DS based
  40.     push    si        ; and push the offset address
  41.     mov     cx,msgl         ; put length of message in cx
  42.         xor     dx,dx           ; zero dx
  43.     push    dx
  44.     push    cx        ; push length of message
  45.     mov    bx,0501h    ; code for current window
  46.     mov    ah,12h        ; code for WRITE message
  47.     int    15h        ; call DESQview to do it
  48. exit:
  49.     mov    ah,4ch        ; function to quit to DOS
  50.     int    21h        ; call DOS
  51.  
  52. ; if here, DESQview must not be present, and we should abort with a message
  53. ; to that effect.
  54.  
  55. abort:
  56.     lea    dx,abort_msg    ; address of abort message where DOS wants it
  57.     mov    ah,09h        ; print $-termintated string to screen
  58.     int    21h        ; call DOS
  59.     jmp    exit        ; and go to exit
  60.  
  61. _text   ends
  62.         end     start
  63.